package net.freebytes.netty;

import io.netty.channel.EventLoop;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class EventLoopTest_1 {
    public static void main(String[] args) {
        // 创建两个线程
        EventLoopGroup eventLoopGroup = new NioEventLoopGroup(2);
        EventLoop next = eventLoopGroup.next();
        next.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println("----------");
            }
        });
        log.info("{}",eventLoopGroup.next());
        log.info("{}",eventLoopGroup.next());
        log.info("{}",eventLoopGroup.next());
        log.info("{}",eventLoopGroup.next());
    }
}
